import { getRandomDateTime, getNowDate, getFeatureDate } from '../../../utils'
import Mock from 'mockjs'
export const resourceConfigMock = pageSize => {
  const result: any[] = []
  for (let i = 0; i < pageSize; i++) {
    result.push({
      id: i + 1,
      name: Mock.mock('@ctitle'),
      remark: Mock.mock('@csentence()'),
      'storage|1': [1, 10, 11, 12, 20],
      master: i === 0 ? true : false,
      config: {
        basePath: '/',
        host: Mock.mock('@ip()'),
        port: Mock.mock('@natural(10, 99999)'),
        username: Mock.Random.word(3, 12),
        password: Mock.Random.word(6, 12),
        'mode|1': ['Active', 'Passive'],
        endpoint: Mock.mock('@ip()'),
        bucket: Mock.Random.word(16, 24),
        accessKey: Mock.Random.word(16, 24),
        accessSecret: Mock.Random.word(16, 24),
        domain: Mock.mock('@domain()')
      },
      imageExts: '.jpg,.png,.jpeg,.gif,.webp',
      videoExts: '.mp4,.m3u8',
      audioExts: '.mp3',
      textExts: '.html,.txt',
      applicationExts: '.pdf,.xlsx,.docx,.zip',
      imageSize: 10 * 1024 * 1024,
      videoSize: 50 * 1024 * 1024,
      audioSize: 30 * 1024 * 1024,
      textSize: 20 * 1024 * 1024,
      applicationSize: 100 * 1024 * 1024,
      creator: '1',
      create_time: getRandomDateTime(getFeatureDate(-10), getNowDate()),
      updater: '',
      update_time: '',
      deleted: false,
      deleted_time: ''
    })
  }
  return result
}
